home *** CD-ROM | disk | FTP | other *** search
- #ifndef __ICONSUITEPATCHES__
- #define __ICONSUITEPATCHES__
-
- #include <Icons.h>
-
- typedef void* IconRef;
- typedef unsigned long IconServicesUsageFlags;
-
- #if PATCHTRAPS
-
- pascal OSErr CallGetIconSuite ( Handle *theIconSuite, SInt16 theResID, IconSelectorValue selector );
- pascal OSErr CallPlotIconSuite ( const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconSuite );
- pascal OSErr CallDisposeIconSuite ( Handle theIconSuite, Boolean disposeData );
- pascal OSErr CallGetIconRefFromFile ( const FSSpec *theFile, IconRef *iconRef, SInt16 *theLabel );
- pascal OSErr CallGetIconRefFromFileInfo ( const FSSpec *theFile, IconRef *iconRef, OSType creator, OSType fileType, Boolean hasCustomIcon );
- pascal OSErr CallGetIconRefFromFolderInfo ( SInt16 vRefNum, SInt32 folderID, IconRef *iconRef, OSType fileType, Boolean hasCustomIcon );
- pascal OSErr CallPlotIconRef ( const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef );
- pascal OSErr CallDisposeIconRef ( IconRef theIconRef );
-
- extern pascal OSErr GetIconRefFromFileInfo(const FSSpec *theFile, IconRef *iconRef, OSType creatorCode, OSType fileType, Boolean hasCustomIcon)
- TWOWORDINLINE(0x7003, 0xAA75);
- extern pascal OSErr PlotIconRef(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
- TWOWORDINLINE(0x700E, 0xAA75);
- extern pascal OSErr DisposeIconRef(IconRef theIconRef)
- TWOWORDINLINE(0x700D, 0xAA75);
-
- pascal void CallCopyBits ( BitMap* srcBits, BitMap* destBits,
- const Rect* srcRect, const Rect* destRect,
- short mode,
- RgnHandle maskRgn );
- pascal OSErr CallNewGWorldRoutine ( GWorldPtr *offscreenGWorld, short PixelDepth,
- const Rect *boundsRect, CTabHandle cTable,
- GDHandle aGDevice, GWorldFlags flags );
- pascal OSErr CallUpdateGWorldRoutine ( GWorldPtr *offscreenGWorld, short PixelDepth,
- const Rect *boundsRect, CTabHandle cTable,
- GDHandle aGDevice, GWorldFlags flags );
- pascal void CallDisposeGWorld ( GWorldPtr offscreenGWorld );
-
- #else
-
- #define GetIconSuite GetIconSuitePatch
- #define PlotIconSuite PlotIconSuitePatch
- #define DisposeIconSuite DisposeIconSuitePatch
-
-
- #define GetIconRefFromFile GetIconRefFromFilePatch
- #define GetIconRefFromFileInfo GetIconRefFromFileInfoPatch
- #define GetIconRefFromFolderInfo GetIconRefFromFolderInfoPatch
- #define PlotIconRef PlotIconRefPatch
- #define DisposeIconRef DisposeIconRefPatch
-
- extern pascal OSErr CallGetIconSuite(Handle *theIconSuite, SInt16 theResID, IconSelectorValue selector)
- THREEWORDINLINE(0x303C, 0x0501, 0xABC9);
- extern pascal OSErr CallDisposeIconSuite(Handle theIconSuite, Boolean disposeData)
- THREEWORDINLINE(0x303C, 0x0302, 0xABC9);
- extern pascal OSErr CallPlotIconSuite(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconSuite)
- THREEWORDINLINE(0x303C, 0x0603, 0xABC9);
-
- extern pascal OSErr CallNewIconSuiteFromFile(const FSSpec *theFile, IconSelectorValue whichIcons, Handle *iconSuite, IconServicesUsageFlags iconServicesUsageFlags)
- TWOWORDINLINE(0x7001, 0xAA75);
- extern pascal OSErr CallGetIconRefFromFile(const FSSpec *theFile, IconRef *iconRef, SInt16 *theLabel)
- TWOWORDINLINE(0x7002, 0xAA75);
- extern pascal OSErr CallGetIconRefFromFileInfo(const FSSpec *theFile, IconRef *iconRef, OSType creatorCode, OSType fileType, Boolean hasCustomIcon)
- TWOWORDINLINE(0x7003, 0xAA75);
- extern pascal OSErr CallGetIconRefFromFolderInfo(SInt16 vRefNum, SInt32 folderID, IconRef *iconRef, OSType fileType, Boolean hasCustomIcon)
- TWOWORDINLINE(0x7004, 0xAA75);
- extern pascal OSErr CallPlotIconRef(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
- TWOWORDINLINE(0x700E, 0xAA75);
- extern pascal OSErr CallDisposeIconRef(IconRef theIconRef)
- TWOWORDINLINE(0x700D, 0xAA75);
-
- #endif
-
- //
- // These are the entry points for our trap patches
- //
- pascal void InstallAllUniversalPatches ( );
-
- pascal OSErr IconUtilitiesTrapPatch ();
- pascal OSErr IconServicesTrapPatch ();
- pascal void InitGrafPatch ( GrafPtr );
-
- pascal void jGNEFilter ( );
- pascal Boolean MyGNEFilterRoutine ( EventRecord* event );
-
- pascal void InstallIconUtilitiesPatches ( );
- pascal void InstallIconServicesPatches ( );
- pascal void InstallGNEFilter ( );
- pascal void InstallDisposeWindowPatch ( );
- pascal void InstallCopyBitsPatch ( );
-
- pascal OSErr NewIconSuiteFromFilePatch (const FSSpec *spec, IconSelectorValue whichIcons, Handle *iconSuite, IconServicesUsageFlags iconServicesUsageFlags);
- pascal OSErr GetIconSuitePatch (Handle *theIconSuite, SInt16 theResID, IconSelectorValue selector);
- pascal OSErr PlotIconSuitePatch (const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconSuite);
- pascal OSErr DisposeIconSuitePatch(Handle theIconSuite, Boolean disposeData);
- pascal OSErr GetIconRefFromFilePatch ( const FSSpec* spec, IconRef *theIconRef, SInt16* label );
- pascal OSErr GetIconRefFromFileInfoPatch ( const FSSpec *spec, IconRef *iconRef, OSType creatorCode, OSType fileType, Boolean hasCustomIcon );
- pascal OSErr GetIconRefFromFolderInfoPatch (SInt16 vRefNum, SInt32 folderID, IconRef *iconRef, OSType fileType, Boolean hasCustomIcon);
- pascal OSErr PlotIconSuitePatch (const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconSuite);
- pascal OSErr PlotIconRefPatch (const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags iconServicesUsageFlags, IconRef iconRef );
- pascal OSErr DisposeIconRefPatch ( IconRef iconRef );
-
- pascal void DisposeWindowPatch ( WindowPtr windowP );
- pascal asm void HideWindowPatch ( GrafPtr );
- pascal void CopyBitsPatch ( BitMap* srcBits, BitMap* destBits,
- const Rect* srcRect, const Rect* destRect,
- short mode, RgnHandle maskRgn );
- asm pascal void QDExtensionsPatch ( );
-
- pascal Boolean MyGNEFilter ( EventRecord* event );
-
- enum
- {
- errForceCallToOriginalPlotIcon = -29500
- };
-
- #endif